<template>
	<mumu-get-qrcode @success='qrcodeSucess' :definition="true" @error="qrcodeError"></mumu-get-qrcode>
</template>

<script>
	import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue'
	export default {
		components: {
			mumuGetQrcode
		},
		data() {
			return {};
		},
		methods: {
			qrcodeSucess(data) {
				let arr = data.split(":")
				uni.$emit("scancode", arr)
				uni.navigateBack(1)
			},
			qrcodeError(err) {
				console.log(err)
				uni.showModal({
					title: '監視器授權失敗',
					content: '監視器授權失敗，請檢測當前瀏覽器是否有監視器許可權。',
					success: () => {
						uni.navigateBack({})
					}
				})
			},
		},
	};
</script>

<style></style>